@extends('home/layout')
@section('content')
<link href="/home/css/personal.css" rel="stylesheet" type="text/css"/>
<div style="background-color: #1C546B; margin-top:none;">
	<div class="container" style="width:900px;"> <!--MC导航-->
		<h2 id="c-title">个人设置 ·<small> 基本资料</small></h2>
		<div>
			<div id="c-body">
				<div class="row" style="height:650px;">
					<div class="col-md-2" id="c-dhl">
						<ul class="list-unstyled">
							<li class="text-right"><strong>基本资料 &nbsp;</strong><span class="fa fa-hand-o-right"></span></li>
							<hr>
							<li class="text-center"><a href="{{ url('/home/user/photo') }}">修改头像</a></li>
							<hr>
							<li class="text-center"><a href="{{ url('/home/user/upwd') }}">修改密码</a></li>
						</ul>
					</div>
					<div class="col-md-10" id="c-form">
						<form class="form-horizontal" action="{{ url('/home/user/update') }}" method="post">
						{{ csrf_field() }}
							<input type="hidden" name="id" value="{{ $data -> id }}">
							<div class="form-group">
							    <label for="inputEmail3" class="col-sm-2 control-label">登录邮箱</label>
							    <div class="col-sm-10">
							      	<input type="email" class="form-control" id="inputEmail3" value="{{ session('master') -> email }}" disabled="disablad">
							    </div>
						  	</div>
						  	<div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">昵称</label>
						    	<div class="col-sm-10">
						      		<input type="text" name="name" class="form-control" id="inputPassword3" value="{{ $data -> name }}">
						    	</div>
						    </div>
						    <div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">qq</label>
						    	<div class="col-sm-10">
						      		<input type="text" name="qq" class="form-control" id="inputPassword3" value="{{ $data -> qq }}" placeholder="qq号码">
						    	</div>
						    </div>
						    <div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">性别</label>
							    <div class="col-sm-10">
						          	<label class="radio-inline">
  										<input type="radio" name="sex" id="inlineRadio1" value="1" 
  										@if($data -> sex == 1)
											checked
										@endif
  										> 男
									</label>
									<label class="radio-inline">
  										<input type="radio" name="sex" id="inlineRadio2" value="0"
  										@if($data -> sex == 0)
											checked
										@endif
										> 女
									</label>
							    </div>
							</div>
							<div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">生日</label>
							    <div class="col-sm-10">
								    <label class="radio-inline">
										<select name="y">
										@for($i = 2015; $i >= 1915; $i--)
											<option value="{{$i}}" 
											@if($data -> birthday[0] == $i)
											selected="selected" 
											@endif
											>{{$i}}</option>
										@endfor
										</select>
										<span>年</span>
									</label>
									<label class="radio-inline">
										<select name="m">
										@for($i = 1; $i <= 12; $i++)
											<option value="{{$i}}"
											@if($data -> birthday[1] == $i)
											selected="selected" 
											@endif
											>{{$i}}</option>
										@endfor
										</select>
										<span>月</span>
									</label>
									<label class="radio-inline">
										<select name="d">
										@for($i = 1; $i <= 31; $i++)
											<option value="{{$i}}"
											@if($data -> birthday[2] == $i)
											selected="selected" 
											@endif
											>{{$i}}</option>
										@endfor
										</select>
										<span>日</span>
									</label>
							    </div>
							</div>
							<div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">居住地</label>
							    <div class="col-sm-10">
								    <label class="radio-inline">
								    	<div id="infos"
										@if(empty($data -> abde))
								    	style="display:none;"
										@endif
								    	>
								    		<div>
												<select name="s_province">
													<option>{{ $data -> abde[0] }}</option>
												</select>  
											    <select name="s_city">
											    	<option>{{ $data -> abde[1] }}</option>
											    </select>
											    <select name="s_county">
											    	<option>{{ $data -> abde[2] }}</option>
											    </select>
											    <script class="resources library" src="/home/js/area.js" type="text/javascript"></script>
											    <script type="text/javascript">_init_area();</script>
										    </div>
								    	</div>
									    <div class="info"
										@if(!empty($data -> abde))
								    	style="display:none;"
										@endif
									    >
											<div>
												<select id="s_province" name="s_province"></select>  
											    <select id="s_city" name="s_city" ></select>  
											    <select id="s_county" name="s_county"></select>
											    <script class="resources library" src="/home/js/area.js" type="text/javascript"></script>
											    <script type="text/javascript">_init_area();</script>
										    </div>
										    <div id="show"></div>
										</div>
									</label>
							    </div>
							</div>
							<div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">个性签名</label>
						    	<div class="col-sm-10">
						      		<textarea class="form-control" name="character" rows="3" style="resize:none;">{{ $data -> character }}</textarea>
						    	</div>
						    </div>
						    <div class="form-group">
						    	<label for="inputPassword3" class="col-sm-2 control-label">个人介绍</label>
						    	<div class="col-sm-10">
						      		<textarea class="form-control" name="introduce" rows="3" style="resize:none;">{{ $data -> introduce }}</textarea>
						    	</div>
						    </div>
							<div class="form-group">
							    <div class="col-sm-offset-2 col-sm-10">
							      	<button type="submit" class="btn btn-default">保存</button>
							    </div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$('#infos').on('click', function(){

		$('#infos').css('display', 'none');
		$('.info').css('display', 'block');
	});
	var info = "{{ session('info') }}";
	if(info != '')
	{
		alert(info);
	}
	
</script>
@endsection